package com.kly.user.enums;

public enum UserStatus {

    INIT(1, "INIT", "初始化"),

    ACTIVE(2, "ACTIVE", "活动"),

    CLOSE(3, "CLOSE", "已关闭");

    private final int type;

    private final String Value;

    private final String description;


    UserStatus(int type, String value, String description) {
        this.type = type;
        Value = value;
        this.description = description;
    }

    public int getType() {
        return type;
    }

    public String getValue() {
        return Value;
    }

    public String getDescription() {
        return description;
    }


    public static UserStatus fromType(int type) {
        for (UserStatus userStatus : values()) {
            if (userStatus.getType() == type) {
                return userStatus;
            }
        }
        throw new IllegalArgumentException("Invalid login type: " + type);
    }
}
